package edu.kjxy.worker0329;

public class worker02 {
	public static double sumDouble(double... data) {
		double sum = 0;
		for (double d : data) {
			sum += d;
		}
		return sum;
	}
	public static int sumInt(int... data) {
		int sum = 0;
		for (int d : data) {
			sum += d;
		}
		return sum;
	}
	public static void main(String[] args) {
		double[] data1 = {1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1};
		int[] data2 = {1, 2, 3, 4, 5, 6, 7};
		
		double sum1 = sumDouble(data1);
		int sum2 = sumInt(data2);
		
		System.out.println(sum1);
		System.out.println(sum2);
		
	}

}
